<template>
  <div class="container">
    <el-dialog title="题目审核" :visible="dialogFormVisible" @close='close' width='500px'>
      <el-form :model="form">
        <el-form-item>
          <el-radio v-model="form.chkState" label="1">通过</el-radio>
          <el-radio v-model="form.chkState" label="2">拒绝</el-radio>
        </el-form-item>
        <el-form-item>
          <el-input
            type="textarea"
            v-model="form.chkRemarks"
            autocomplete="off"
             placeholder="请输入审核意见"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button  @click="close">取 消</el-button>
        <el-button type="primary" @click="auditChoiceCheck"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { choiceCheck } from '@/api/hmmm/questions.js'
export default {
  props: {
    auditRow: {
      type: Object,
      required: true
    },
    dialogFormVisible: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      form: {
        chkState: '1',
        chkRemarks: ''

      }
    }
  },
  methods: {
    // 点击确定
    async  auditChoiceCheck () {
      if (this.form.checkIdea === '') {
        this.$message.warning('请输入审核意见')
        return
      }
      await choiceCheck({
        id: this.auditRow.id,
        ...this.form
      })
      this.$message.success('操作成功')
      this.close()
    },
    // 关闭
    close () {
      this.$emit('update:dialogFormVisible', false)
    }
  }
}
</script>

<style scoped lang='less'></style>
